import 'package:flutter/material.dart';

class ListViewDemo extends StatelessWidget {
  List<String> list;
  ListViewDemo(this.list);
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("长列表"),
        centerTitle: true,
      ),
      body: ListView.builder(
        itemBuilder: (context, index) {
          return ListTile(
            leading: Icon(Icons.contact_phone),
            title: Text("${list[index]}"),
          );
        },
        itemCount: list.length,
      ),
    );
  }
}
